package com.liwy3.product.controller;

import com.liwy3.common.domain.R;
import com.liwy3.product.entity.SysUserEntity;
import com.liwy3.product.mapper.SysUserMapper;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Copyright © 元气森林（北京）食品科技集团有限公司. All rights reserved.
 *
 * @Description:
 * @author: Crazy4J
 * @date: 2022年02月24日 15:39
 * @version: V1.0
 */
@RestController
public class ProductController {

    @Resource
    private SysUserMapper sysUserMapper;

    @PostMapping("/product/add")
    public R<?> add(@RequestParam("num") Integer num) throws InterruptedException {
        System.out.println("加商品数:" + num);
        SysUserEntity sysUserEntity = sysUserMapper.selectById(114L);
//        if (1 == 1) {
//            throw new RuntimeException("加商品报错了!!");
//        }
//        Thread.sleep(10000);
        sysUserEntity.setMerId("10090");
        sysUserMapper.updateById(sysUserEntity);

        return R.ok();
    }



}
